package LuoGu.模拟与高精度.麦森数;

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    static BigInteger t = new BigInteger("2");
    static BigInteger o = new BigInteger("1");
    public static void main(String [] args){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        String ans = "";
        //快速幂
        ans = fast(t,n).subtract(o).toString();
        int nn = ans.length();
        System.out.println(nn);
        int index;
        if(nn<500){
            for(index=1;index<=500-nn;index++){
                System.out.print(0);
                if(index%50==0) System.out.println();
            }
            index--;
            for(int i=0;i<nn;i++){
                System.out.print(ans.charAt(i));
                index++;
                if(index%50==0) System.out.println();
            }
        }
        else{
            index = nn-500;
            for(int i=0;i<10;i++){
                for(int j=0;j<50;j++){
                    System.out.print(ans.charAt(index++));
                }
                System.out.println();
            }
        }
    }

    public static BigInteger fast(BigInteger b,int n){
        BigInteger ans = o;
        while(n!=0){
            if((n&1)==1){
                ans = ans.multiply(b);
            }
            n>>=1;
            b = b.multiply(b);
        }
        return ans;
    }
}
